package com.company.user.entity;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.io.Serializable;

/**
 * Cloud实体
 */
@Component
@ConfigurationProperties(prefix = "spring.cloud.consul")
public class ConsulCloudEntity implements Serializable {

    @Value("${spring.cloud.consul.discovery.instance-id}")
    private String instanceId;

    private String host;

    private String port;

    public String getInstanceId() {
        return instanceId;
    }

    public void setInstanceId(String instanceId) {
        this.instanceId = instanceId;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public String getPort() {
        return port;
    }

    public void setPort(String port) {
        this.port = port;
    }

    @Override
    public String toString() {
        return "ConsulCloudEntity{" +
                "instanceId='" + instanceId + '\'' +
                ", host='" + host + '\'' +
                ", port='" + port + '\'' +
                '}';
    }
}
